<%@page import="com.swm.julie.rest.crud.twitt.TwittDocFormat"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Search Result</title>
<script type="text/javascript">
function onAction(action, id)
{
	location.href="/" + action.value + ".do?id=" + id;  
}
</script>
<style type="text/css">
.twitt
{
background-color: #CC99CC;
}
#update
{
float:left
}
</style>
<%
/** format the web UI and response page of search twitts result **/
ArrayList<TwittDocFormat> result = (ArrayList<TwittDocFormat>) request.getAttribute("result");
%>
</head>
<body>
<h1>Search Result</h1>
<div class="twittWrapper">
<%
if(result != null && result.size() > 0)
{
	for(TwittDocFormat twitt : result)
	{%>
<ul class="twitt">
<li name="id">id : <%= twitt.getId() %></li>
<li name="postdate">postdate : <%= twitt.getPostdate() %></li>
<li name="contents">contents : <%= twitt.getContents() %></li>
<li name="linkInfo">linkInfo : <%= twitt.getLinkInfo() %></li>
<li name="posturl">posturl : <%= twitt.getPostUrl() %></li>
<input type="button" id="update" value="update" onclick="onAction(this, <%= twitt.getId()%>)">
<input type="button" id="delete" value="delete" onclick="onAction(this, <%= twitt.getId()%>)"> 
</ul>
<%}}else{ %>empty <%} %>
</div>
<input type="button" value="home" onclick="location.href='/index.html'"> 
</body>
</html>